/*
* Filename:
* Summary:	
*
* Author:
* Version:
* Finished time:
*/
#include "head.h"
#include "popmenu.h"
#include "ipmsg.h"
#include "mainwindow.h"
/*
*callback functions
*/
static void set_preference()
{
}
static void show_help()
{
}
static void show_about()
{
}
/*global variables*/
GtkWidget *pop_menu;
/*menu itemfactory*/
static GtkItemFactoryEntry menu_items[] = {
	{ "/_Preferences",  "<control>P", set_preference, 0, NULL},
	{ "/_Help",         "<control>H", show_help,      0, NULL},
	{ "/_About",        "<control>A", show_about,     0, NULL},
	{ "/sep",           NULL,         NULL,           0, "<Separator>"},
	{ "/_Quit",         "<control>Q", gtk_main_quit,  0, NULL},
};


/*
* Function:
* Summary:
*
* Argument:
* 1th argument --
* 2th argument --
*
* Return:
*  
*/
void NewPopMenu()
{
	GtkItemFactory *item_factory;
	GtkAccelGroup *accel_group;
	gint nmenu_items = sizeof (menu_items) / sizeof (menu_items[0]);
	accel_group = gtk_accel_group_new();    
	item_factory = gtk_item_factory_new(GTK_TYPE_MENU, "<main>", accel_group);
	gtk_item_factory_create_items (item_factory, nmenu_items, menu_items, NULL);
	//bind accel_group to window
	gtk_window_add_accel_group (GTK_WINDOW (main_window), accel_group);
	//return the popmenu which is created before
	pop_menu = gtk_item_factory_get_widget (item_factory, "<main>");
}


